
//
//  JSTableViewCell.m
//  JSPhotoSDK
//
//  Created by shan on 2017/6/1.
//  Copyright © 2017年 shan. All rights reserved.
//

#import "JSTableViewCell.h"
#import "IJSImageAPIManager.h"


@interface JSTableViewCell ()
/* 参数说明 */
@property (nonatomic, weak) UIImageView *jsimage;
@end


@implementation JSTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(1, 1, 80, 80)];
        [self.contentView addSubview:image];
        image.backgroundColor = [UIColor redColor];
        self.jsimage = image;
    }
    return self;
}

- (void)setAsset:(PHAsset *)asset
{
    //    _asset =asset;
    //    NSString *burstIdentifier = asset.localIdentifier;
    //    __weak typeof (self) weakSelf = self;
    //    [[IJSImageAPIManager shareManager]getImageFromAsset:asset targetSizeWidth:600 contentMode:PHImageContentModeAspectFill options:nil networkAccessAllowed:NO completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
    //        if([burstIdentifier isEqualToString:weakSelf.asset.localIdentifier])
    //        {
    //            weakSelf.jsimage.image = photo;
    //            NSLog(@"--l---%@",photo);
    //        }
    //        NSLog(@"----s---%@",info);
    //
    //    } progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
    //        NSLog(@"----w---%@",info);
    //    }];
}


- (void)awakeFromNib
{
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
